package com.googlecode.monitoria.client.beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * @author Ricardo Araújo Santos - ricardo@lsd.ufcg.edu.br
 */
@Entity(name="MUser")
public class User implements Persistable{
	
	private static final long serialVersionUID = -3745502546772230783L;

	@Id
	private String name;
	
	@Column
	private String password;
	
	@Column
	private UserType type;
	
	/**
	 * Default empty constructor.
	 */
	public User() {
	}

	/**
	 * Default constructor using fields.
	 * @param name User name.
	 * @param password Password.
	 * @param type User type according to {@link UserType}.
	 */
	public User(String name, String password, UserType type) {
		this.name = name;
		this.password = password;
		this.type = type;
	}

	/**
	 * @return the name
	 */
	public String getName() {
	
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName( String name ) {
	
		this.name = name;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
	
		return password;
	}

	/**
	 * @param password the password to set
	 */
	public void setPassword( String password ) {
	
		this.password = password;
	}

	/**
	 * @return the type
	 */
	public UserType getType() {
	
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType( UserType type ) {
	
		this.type = type;
	}

	@Override
	public String toString() {
		return "Name: " + name;
	}
}
